import axios from '@/api/fetch';
//import * as types from './types';
import SERVER from '@/api/server';

//旧件回运仓库查询--按下线工厂--经销商
//旧件回运仓库查询--按下线工厂-主页面查询
export const getListByPage = params => axios.post(`${SERVER.CLAIMDEALER}/rPReturnWhFac/getListByPage`,  params );
//新增的保存
export const newSave = params => axios.post(`${SERVER.CLAIMDEALER}/rPReturnWhFac/saveOne`,  params );
//批量启动
export const piliangqiyong = data => axios.post(`${SERVER.CLAIMDEALER}/rPReturnWhFac/updateEnableByIds`,  null ,{params : data} );
//批量停用
export const piliangtingyong = data => axios.post(`${SERVER.CLAIMDEALER}/rPReturnWhFac/updateEnableByIds`,  null ,{params : data} );
//Excel导出
// export const excelExport = params => axios.get(`${SERVER.CLAIMDEALER}/rPReturnWhFac/getListForExport`, params);
// export const excelExport = params => axios.post(`${SERVER.CLAIMDEALER}/rPReturnWhFac/getListForExport`,  params );

export const excelExport = params => {
  return axios({
    url:`${SERVER.CLAIMDEALER}/rPReturnWhFac/getListForExport`,
    method: 'get',
    params: params,
    responseType: 'blob'
  });
};
//一般车辆配件类型保修期编辑弹窗的保存
export const editSave = params => axios.post(`${SERVER.CLAIMDEALER}/rPReturnWhFac/updateByPtId`,  params );

//导出
export const getListForExport = (params) => axios.post(`${SERVER.CLAIMDEALER}/rPReturnWhFac/getListForExport`, params, {
  responseType: 'blob'
});
  //下载中心导出
  export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);

// // 客户订单页查询
// export const getOrders = params => axios.get(`${SERVER.CYXDMS_RETAIL}/ordermanage/customerOrders`, { params });

// // 新增客户订单
// export const addOrders = params => axios.post(`${SERVER.CYXDMS_RETAIL}/ordermanage/customerOrders`, { params });

// // 修改客户订单
// export const modifyOrders = params => axios.put(`${SERVER.CYXDMS_RETAIL}/ordermanage/customerOrders`, { params });

// // 根据id查询客户订单
// export const quyOrders = (id, params) => axios.get(`${SERVER.CYXDMS_RETAIL}/ordermanage/customerOrders/${id}`, { params });

// // 查询车辆列表
// export const quyvehicle = (id, params) => axios.get(`${SERVER.CYXDMS_RETAIL}/ordermanage/customerOrders/${id}/vehicleList`, { params });

// // 删除客户订单(物理删除)
// export const deleteOrders = params => axios.post(`${SERVER.CYXDMS_RETAIL}/ordermanage/customerOrders/delete`, { params });

// // 订单经理审核查询
// export const managerAudit = params => axios.get(`${SERVER.CYXDMS_RETAIL}/ordermanage/customerOrders/manageVerify/query`, { params });

// 删除客户订单(物理删除)
//export const deleteOrders = params => axios.post(`${SERVER.DCSCLOUD_SALES}/ordermanage/customerOrders/delete`, { params });

// 撤回客户订单
//export const withdrawOrders = (id, params) => axios.post(`${SERVER.DCSCLOUD_SALES}/ordermanage/customerOrders/withdraw/${id}`, { params });

// 提交客户订单
//export const subOrders = params => axios.post(`${SERVER.DCSCLOUD_SALES}/ordermanage/customerOrders/submit`, { params });

// 作废客户订单(逻辑删除)
//export const toVOrders = (id, params) => axios.post(`${SERVER.DCSCLOUD_SALES}/ordermanage/customerOrders/nullify/${id}`, { params });




